<?php
require_once "common.php";
//@$part=new part();
//$menu=$part->showMenu();
//print_r($menu);
//@$part=new part();
//$partArray=$part->showPart();
$pid=$_GET[pid];
if($pid!=""){
	@$part=new part($pid,'','');
	$article=new article('','','',$pid,'','');
	$partArray=$part->showPart();
	$menu=$part->showMenu();
	$list=$article->partList();
}
?>
<html>
	<head>
	<title>栏目列表</title>
	<link rel="stylesheet" href="./css/list.css" type="text/css">
	</head>
	<body>
		<div id="container">
			<div id="header">
				<div id="logo" class="bgcolor">LOGO</div>
				<div id="banner">
					<div id="left" class="bgcolor">BANNER1</div>
					<div id="right" class="bgcolor">BANNER2</div>
				</div>
			</div>
			<div class="nav"></div>
			<div id="menu" class="bgcolor">
			<?php for($i=0;$i<=count($menu);$i++){
				echo "<a href=./list.php?pid=".$menu[$i][pid].">".$menu[$i][part]."</a>&nbsp";											
			} ?>
			</div>
			<div class="nav"></div>
			<div id="content">
			<div id="navigate" style="text-align:left;"><?php $nav=new navigation($pid,'');$nav->showNavigate(); ?></div>
			<?php
			//需要添加分页功能
			for($i=0;$i<count($list)-1;$i++){
				//echo $list[$i][title]."<br />";
				echo "<a href=./content.php?pid=".$pid."&aid=".$list[$i][aid].">".$list[$i][title]."</a><br/>";
			}
			?>
			</div>
			<div id="sidebar">
				<div class="bar border"><?php echo $partArray[3][part]; ?></div>
				<div class="nav"></div>
				<div class="bar border"><?php echo $partArray[4][part]; ?></div>
				<div class="nav"></div>
				<div class="bar border"><?php echo $partArray[5][part]; ?></div>
				<div class="nav"></div>
			</div>
			<div class="nav"></div>
			<div id="footer" class="bgcolor">页脚</div>
		</div>
			
	</body>
</html>